# COREWAR MAKEFILE - LINUX - Emmanuel Roussel

CC = g++
FLAGS = -Wall
RM = rm -f
GTK = `pkg-config --cflags --libs gtk+-2.0`

SOURCES = ../src/com_main.cpp ../src/main.cpp ../src/out_compilateur.cpp ../src/out_drawing.cpp ../src/out_gestionSDL.cpp ../src/out_Instruction.cpp ../src/out_main.cpp ../src/out_Memoire.cpp
OBJECTS = com_main.o main.o out_compilateur.o out_drawing.o out_gestionSDL.o out_Instruction.o out_main.o out_Memoire.o
LIB = -lSDL -lpthread
EXBIN = bin/CoreWar

all:
	@echo  
	@echo ----------------------------------------------------------------------
	@echo Compilation of $(EXBIN) in progress !! - release version
	@echo Emmanuel Roussel
	@echo ----------------------------------------------------------------------
	@echo 

	$(CC) $(FLAGS) $(GTK) -c $(SOURCES) -export-dynamic 
	$(CC) $(FLAGS) $(GTK) $(OBJECTS) $(LIB) -o $(EXBIN) -export-dynamic 
	$(RM) *.o
	
debug:
	@echo  
	@echo ----------------------------------------------------------------------
	@echo Compilation of $(EXBIN) in progress !! - debug version
	@echo type gdb $(EXBIN) to run the gdb debugger
	@echo Emmanuel Roussel
	@echo ----------------------------------------------------------------------
	@echo 

	$(CC) -g $(FLAGS) $(GTK) -c $(SOURCES) -export-dynamic 
	$(CC) $(FLAGS) $(GTK) $(OBJECTS) $(LIB) -o $(EXBIN) -export-dynamic 
	$(RM) *.o

clean:
	$(RM) $(EXBIN)
	$(RM) *.o
